import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: '主页',
      component: () => import('../views/Home/HomeMain.vue')
    },

    // {
    //   path: '/mask/index',
    //   name: '钱包首页',
    //   component: () => import('../views/Mask/MaskIndex.vue')
    // },

    {
      path: '/login',
      name: '登录',
      component: () => import('../views/Login/LoginPage.vue')
    },
    {
      path: '/register',
      name: '注册',
      component: () => import('../views/Login/RegisterPage.vue')
    },
    {
      path: '/count',
      name: '碳核算母版',
      redirect: '/count/home',
      component: () => import('../views/CarbonCount/CountMain.vue'),
      children: [
        {
          path: 'home',
          name: '碳核算',
          component: () => import('@/views/CarbonCount/CountHome.vue')
        },
        {
          path: 'cal',
          name: '碳核算模型',
          component: () => import('@/views/CarbonCount/CountCal.vue')
        },
        {
          path: 'upload',
          name: '核算数据上传',
          component: () => import('@/views/CarbonCount/UploadData.vue')
        }
      ]
    },
    {
      path: '/trade',
      name: '碳交易母版',
      redirect: '/trade/market',
      component: () => import('@/views/CarbonTrade/TradeMain.vue'),
      children: [
        {
          path: 'market',
          name: '碳交易市场',
          component: () => import('@/views/CarbonTrade/TradeMarket.vue')
        },
        {
          path: 'direct',
          name: '定向交易',
          component: () => import('@/views/CarbonTrade/TradeDirect.vue')
        },
        {
          path: 'group',
          name: '群组交易',
          component: () => import('@/views/CarbonTrade/TradeGroup.vue')
        },
        {
          path: 'create',
          name: '挂牌',
          component: () => import('@/views/CarbonTrade/TradeCreate.vue')
        }
      ]
    },
    {
      path: '/user',
      name: '个人中心',
      redirect: '/user/index',
      component: () => import('../views/UserCenter/UserMain.vue'),
      children: [
        {
          path: 'index',
          name: '个人首页',
          component: () => import('../views/UserCenter/UserIndex.vue')
        },
        {
          path: 'publicmsg',
          name: '公告消息',
          component: () => import('../views/UserCenter/UserMsg.vue')
        },
        {
          path: 'enterpriseCertification',
          name: '企业认证',
          component: () => import('../views/UserCenter/EnterpriseCertification.vue')
        },
        {
          path: 'enterpriseEdit',
          name: '企业资料编辑',
          component: () => import('../views/UserCenter/EnterpriseEdit.vue')
        },
        {
          path: 'goodsList',
          name: '我的上架',
          component: () => import('../views/UserCenter/MyGoodsList.vue')
        },
        {
          path: 'carbonTradeList',
          name: '碳交易记录',
          component: () => import('../views/UserCenter/CarbonTradeList.vue')
        },
        {
          path: 'carbonCountList',
          name: '碳核算记录',
          component: () => import('../views/UserCenter/CarbonCountList.vue')
        },
        {
          path: 'mask/login',
          name: '登录钱包',
          component: () => import('../views/Mask/MaskLogin.vue')
        },
        {
          path: 'maskIndex',
          name: '钱包首页',
          component: () => import('../views/Mask/MaskIndex.vue')
        },
        // {
        //   path: 'mask/register',
        //   name: '创建钱包',
        //   component: () => import('../views/Mask/MaskRegister.vue')
        // },
        {
          path: 'mask/info',
          name: '钱包信息',
          component: () => import('../views/Mask/MaskInfo.vue')
        }
      ]
    },
    {
      path: '/test',
      name: 'test',
      component: () => import('../views/test/test.vue')
    },
    {
      path: '/admin',
      name: '管理页面',
      children: [
        {
          path: 'audit',
          name: '数据审核',
          component: () => import('../views/Admins/DataAudit/DataAudit.vue')
        },
        {
          path: 'supervis',
          name: '数据监管',
          component: () => import('../views/Admins/DataSupervision/DataSupervision.vue')
        },
        {
          path: 'usermanage',
          name: '用户管理',
          component: () => import('../views/Admins/UserManagement/UserManagement.vue')
        }
      ]
    }
  ]
})

export default router
